<script type="text/javascript">
    $(function() {
        $('#datetimepicker3').datetimepicker({
            pickTime: false
        });
    });
    function modalCompany(){
        $('#free').load("<?=  base_url()?>company/popup");
    }
    function setCompany(id, name){
        $("#txtOfficename").val(name);
        $("#txtOfficeid").val(id);
        $('#free').modal('hide');
    }
    function addCompany(){
        $('#free').load("<?=  base_url()?>company/popupadd");
    }
    
</script>
<form method="post" action="#">
    <div class="row">
        <div class="span12">
            <h4>Form Lowongan Pekerjaan</h4><br/><br/>
            <div class="row">
                <div class="span3">Title</div>
                <input type="text" name="txtTitle" class="span6" id="txtTitle" value="<?= @$low->title ?>"/>
                <font class="strerr"><?= @$err->title ?></font>
            </div>
            <div class="row">
                <div class="span3">Perusahaan</div>
                <input type="text" name="txtOfficename" class="span3" onfocus="modalCompany()" id="txtOfficename" readonly="readonly" data-toggle="modal"  href="#free" value="<?= getOfficeName(@$low->officeid) ?>"/>
                <input type="hidden" name="txtOfficeid" id="txtOfficeid" value="<?= @$low->officeid ?>"/>
                <font class="strerr"><?= @$err->officeid ?></font>
            </div>
            <div class="row">
                <div class="span3">Penempatan</div>
                <input type="text" name="txtLocation" id="txtLocation" value="<?= @$low->location ?>"/>
                <font class="strerr"><?= @$err->location ?></font>
            </div>
            <div class="row">
                <div class="span3">Keahlian yang dibutuhkan</div>
                <textarea name="txtQualification" class="span6" id="txtQualification"><?= @$low->qualification ?></textarea>
                <font class="strerr"><?= @$err->location ?></font>
            </div>
            <div class="row">
                <div class="span3">Pengalaman yang dibutuhkan</div>
                <textarea name="txtExperience" class="span6" id="txtExperience"><?= @$low->experience ?></textarea>
                <font class="strerr"><?= @$err->location ?></font>
            </div>
            <div class="row">
                <div class="span3">Jenis Kelamin <?= @$low->gender?></div>
                <select name="ddJenkel" id="ddJenkel">
                    <option value="-"<?= @$low->gender == "-" ? ' selected="selected"' : "" ?>>Semua</option>
                    <option value="L"<?= @$low->gender == "L" ? ' selected="selected"' : "" ?>>Laki-laki</option>
                    <option value="P"<?= @$low->gender == "P" ? ' selected="selected"' : "" ?>>Perempuan</option>
                </select>
                <font class="strerr"><?= @$err->gender ?></font>
            </div>
            <div class="row">
                <div class="span3">Umur</div>
                <select name="ddAgemin" id="ddAgemin" style="width: 50px;">
                    <? for ($i = 16; $i < 100; $i++): ?>
                        <option value="<?= $i ?>"<?= @$low->agemin == $i ? ' selected="selected"' : "" ?>><?= $i ?></option>
                    <? endfor; ?>
                </select>
                -
                <select name="ddAgemax" id="ddAgemax" style="width: 50px;">
                    <? for ($i = 16; $i < 100; $i++): ?>
                        <option value="<?= $i ?>"<?= @$low->agemax == $i ? ' selected="selected"' : "" ?>><?= $i ?></option>
                    <? endfor; ?>
                </select>
                <font class="strerr"><?= @$err->age ?></font>
            </div>
            <div class="row">
                <div class="span3">Pendidikan</div>
                <input type="text" name="txtEducation" id="txtEducation" value="<?= @$low->education ?>"/>
                <font class="strerr"><?= @$err->education ?></font>
            </div>
            <div class="row">
                <div class="span3">Salary</div>
                <input type="text" name="txtSalary" id="txtSalary" value="<?= @$low->salary ?>"/>
                <font class="strerr"><?= @$err->salary ?></font>
            </div>
            <div class="row">
                <div class="span3">Catatan</div>
                <textarea name="txtNote" class="span6" id="txtNote"><?= @$low->note ?></textarea>
                <font class="strerr"><?= @$err->location ?></font>
            </div>
            <div class="row"> 
                <div class="span3">Berlaku sampai</div>
                <div id="datetimepicker3" class="input-append">
                    <input name="txtOpenuntil" id="txtOpenuntil" data-format="yyyy-MM-dd" type="text" value="<?= @$low->openuntil ?>" readonly="readonly" />
                    <span class="add-on">
                        <i data-time-icon="icon-time" data-date-icon="icon-calendar">
                        </i>
                    </span>
                    &nbsp;<font class="strerr"><?= @$err->openuntil ?></font>
                </div>
            </div>
            <input type="submit" class="btn btn-primary" value="Simpan"/>
            <a class="btn btn-dark" href="<?= base_url() ?>lowker">Batal</a>
        </div>
    </div>
</form>
<div class="modal hide fade" id="free"></div>